home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 January: Mac OS SDK / Dev.CD Jan 97 SDK2.toast / Development Kits (Disc 2) / OpenDoc Development Framework / Documentation / Development Notes / About SOMxxxx Files < prev    next >
Encoding:
Text File  |  1996-09-19  |  3.1 KB  |  74 lines  |  [TEXT/ttxt]

  1. OpenDoc
  2. Development
  3. Framework
  4.                                                                                                                                                                                     
  5. About SOMxxxx Files 
  6. ODF Release 2                                                                                                                                                             
  7.  
  8. This document provides information about ODF's SOM files.
  9.  
  10.  
  11. Table of Contents
  12. -------------------------
  13. • Summary
  14. • Updating Existing Code
  15. • Compiling Other IDL Files
  16.  
  17.  
  18.  
  19. Summary
  20.  
  21. In all of our examples, we have renamed SOMPart.cpp to SOMPtMc.cpp (it stands for SOM Part Macro). SOMIter.cpp has also been renamed to SOMItMc.cpp. This was done to fix problems with our build system which interfered with developing extensions. We suggest that you make this change to your parts as well.
  22.  
  23. Normally, the SOM compiler will generate a source file (.cpp extension) from an IDL file (.idl extension), or if one exists it will be updated. ODF uses large macros in the implementation of the SOM .cpp files, which the SOM compiler can't handle well. Therefore we had commented out the build rules for updating the .cpp file. This prevented developers from writing extensions (which require .idl and .cpp files) without changing our build system.
  24.  
  25. Because we haven't found any way to prevent the SOM compiler from trying to update our .cpp files, we renamed them so they don't match the .idl files. If you use MPW for development then you should do this as well, since under the newly uncommented rules the SOM compiler will try to update your SOMPart.cpp (or SOMIter.cpp) files. Note that if you are writing extensions then you don't have to rename their .cpp files.
  26.  
  27.  
  28.  
  29. Updating Existing Code
  30.  
  31. • If you are updating a pre-ODF2 part:
  32.  
  33. Rename your SOMPart.cpp file to SOMPartMacro.cpp. If your part does embedding, rename SOMIter.cpp to SOMIterMacro.cpp. You will need to change your MacMake.bmk file, as well, from this:
  34.  
  35. __ComponentObjects = ∂
  36.     "{_FWObjDir}SOMPart.cpp.o" ∂
  37.     …
  38.  
  39. to this:
  40.  
  41. __ComponentObjects = ∂
  42.     "{_FWObjDir}SOMPartMacro.cpp.o" ∂
  43.     …
  44.  
  45. Also remove the dependency from .cpp to .idl. It probably looks like this:
  46.  
  47. "{_FWTargetDir}SOMPtMc.cpp" ƒ ∂
  48.     "{_FWTargetDir}SOMPart.idl" ∂
  49.     "{_FWTargetDir}SOMPart.xh" ∂
  50.     "{_FWTargetDir}SOMPart.xih"
  51.  
  52. However it should actually read like this:
  53.  
  54. "{_FWTargetObjectsDir}SOMPtMc.cpp.o" ƒ ∂
  55.     "{_FWTargetDir}SOMPart.xh" ∂
  56.     "{_FWTargetDir}SOMPart.xih"
  57.  
  58.  
  59.  
  60. Compiling Other IDL Files
  61.  
  62. If you are writing an extension or otherwise adding a .idl file to your project, add two dependencies to your makefile, like this:
  63.  
  64. "{_FWTargetDir}MyExtension.cpp" ƒ ∂
  65.     "{_FWTargetDir}MyExtension.idl"
  66.  
  67. "{_FWTargetObjectsDir}MyExtension.cpp.o" ƒ ∂
  68.     "{_FWTargetDir}MyExtension.xh" ∂
  69.     "{_FWTargetDir}MyExtension.xih"
  70.  
  71. CodeWarrior developers using the SOMobjectsTS plugin should also add the .idl file to the project window.
  72.  
  73. © 1993 - 1996 Apple Computer, Inc. All rights reserved.
  74. Apple, the Apple Logo, Macintosh, and OpenDoc are trademarks of Apple Computer, Inc., registered in the United States and other countries.